package com.jzhao.jpre.model;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.dao.DataAccessException;

import com.jzhao.jpre.base.StringPublicDeal;
import com.jzhao.jpre.model.dao.BusiTypeDao;


public class TestBusiType {
	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext(
				"beans.xml");
		
		BusiTypeDao busiTypeDao = (BusiTypeDao)context.getBean("busiTypeDao");
		StringPublicDeal cc = (StringPublicDeal) context.getBean("stringPublicDeal");
		
		BusiType busiType = new BusiType();
		try {
			busiType = busiTypeDao.selectByBusiType("T1");
			System.out.println("BusiType = " + busiType.getBusiType());
			System.out.println("BusiName = " + busiType.getBusiName());
			System.out.println("Memo = " + cc.convToGB2312(busiType.getMemo()));
		} catch (DataAccessException dae) {
			System.out.println("The record doesn't exist!");
		}
	}
}
